﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.IO; 
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class logoViewSmall : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        dbProcessor my_db = new dbProcessor();

        int CompId = Convert.ToInt32(Request.Params["CompId"]);

        byte[] selected_image = my_db.select_small_image(CompId);

        if (selected_image == null)
        {
            FileStream fs = File.OpenRead(Request.PhysicalApplicationPath + "\\thumbs\\default_small.jpeg");
            byte[] data = new byte[fs.Length];
            fs.Read(data, 0, data.Length);

            selected_image = data; 
        }
             
        Response.BinaryWrite(selected_image);       
   }
}